<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\Advert
 *
 * @property-read \App\Models\Position $position
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Advert newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Advert newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Advert query()
 * @mixin \Eloquent
 * @property int $id
 * @property string $title 广告标题
 * @property string $thumb 图片链接
 * @property string|null $link 跳转链接
 * @property int $sort 排序
 * @property int $position_id 位置ID
 * @property string|null $description 广告描述
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Advert whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Advert whereDescription($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Advert whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Advert whereLink($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Advert wherePositionId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Advert whereSort($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Advert whereThumb($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Advert whereTitle($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Advert whereUpdatedAt($value)
 */
class Advert extends Model
{

    protected $fillable = ['title','thumb','link','position_id','sort','description'];
    //广告所在的位置信息
    public function position()
    {
        return $this->belongsTo('App\Models\Position');
    }

}
